﻿/**********************************************************************
 * @file   FITKSpectraAbstractPower.h
 * @brief  同功率谱算法一致抽象类
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date   2024-12-04
 *********************************************************************/
#ifndef _FITKSpectraAbstractPower_H
#define _FITKSpectraAbstractPower_H

#include "FITKAcousticsPhysicsAPI.h"
#include "FITKAcousticsAbstractSpectra.h"

namespace Acoustics
{
    /**
     * @brief  同模态密度谱算法一致抽象类
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date   2024-12-04
     */
    class FITKAcousticsPhysicsAPI FITKSpectraAbstractPower : public FITKAcousticsAbstractSpectra
    {
        Q_OBJECT;
    public:
        /**
         * @brief    构造函数
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-04
         */
        explicit FITKSpectraAbstractPower();
        /**
         * @brief    析构
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-04
         */
        virtual ~FITKSpectraAbstractPower();
        /**
         * @brief    拷贝函数
         * @param[i] copyData         数据对象
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-10
         */
        virtual void copy(FITKAcousticsAbstractSpectra* copyData) override;
        /**
         * @brief    设置dB计算的启用状态
         * @param[i] enableState 
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-04
         */
        void setDBEnableState(bool enableState);
        /**
         * @brief    获取dB计算的启用状态
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-04
         */
        bool getDBEnableState();
        /**
         * @brief    获取DB的默认系数-纯虚
         * @return   double
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-04
         */
        virtual double getDBDefaultCoefficient() = 0;
        /**
         * @brief    设置DB的用户配置系数
         * @param[i] coeff 
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-04
         */
        void setDBUserCoefficient(double coeff);
        /**
         * @brief    获取DB的用户配置系数
         * @return   double
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-04
         */
        double getDBUserCoefficient();
        /**
         * @brief    db是否是用户定义
         * @return   bool true : 是用户定义 false : 默认数据
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-04
         */
        bool isDBUserDefined();
        /**
         * @brief    设置A权启用状态
         * @param[i] enableState 
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-04
         */
        void setAWeightingEnableState(bool enableState);
        /**
         * @brief    获取A权启用状态
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-04
         */
        bool getAWeightingEnableState();
        /**
         * @brief    设置Form类型
         * @param[i] type 0:RMS 
         *         1:PSD in unit/Hz 
         *         2:PSD in g^2/Hz
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-04
         */
        void setFormCalcType(int type);
        /**
         * @brief    获取Form类型
         * @return   int
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-04
         */
        int getFormCalcType();
        /**
         * @brief    获取实际操作之后的频谱数据
         * @return   QList<SpectraValue>
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-04
         */
        virtual QList<SpectraValue> getRealSpectraValue() override;

    private:
        /**
         * @brief  dB的启用状态
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-04
         */
        bool _dBEnableState{ false };
        /**
         * @brief  用户设置的系数
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-04
         */
        double _dBUserCoefficient{ 0.0 };
        /**
         * @brief  A权的启用状态
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-04
         */
        bool _aWeightingEnableState{ false };
        /**
         * @brief  0:RMS 
         *         1:PSD in unit/Hz 
         *         2:PSD in g^2/Hz
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-04
         */
        int _formCalcType{ 0 };
    };
}

#endif
